<?php

namespace app\admin\validate;

use think\Validate;

class BillSettingValidate extends Validate
{
    protected $rule = [
        'buy_time' => 'require',
        "id" => 'require',
        "profit_percent" => 'require|number',
        "status" => 'require|in:1,-1',
        "is_win" => 'in:0,1'
    ];

    protected $message = [
        'buy_time.require' => '跟单时间必须选择',
        "id.require" => "缺少id",
        "profit_percent.require" => "亏损比例必须填写",
        "profit_percent.number" => "亏损必须是数字",
        "status.in" => "状态值错误",
        "status.require" => "缺少状态值",
        "is_win.in" => "是否盈利错误"
    ];

    protected $scene = [
        'edit' => ['buy_time', 'id', 'profit_percent', 'is_win'],
        'status' => ['id', 'status'],
    ];

}